package poe;
import java.util.Scanner;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
public class pomain {
    public static void main(String[] args) throws IOException {
        Scanner scanner = new Scanner(System.in);
        int q=0,a=0,w=7,b=7,e,r,k=0;
        String fn="F:\\Javahub\\jub.txt";
        String cont="",cot="",ct="";
        String content = new String(Files.readAllBytes(Paths.get(fn)));
        String sur=scanner.nextLine();

        for(int i=0;i<120;i++) {
           ct=content.substring(a, b);
           cont+=content.substring(a, b)+"\n";

           if(sur.length()==1) {
              for(int q1=0;q1<6;q1++){
                e=0;
                r=1;
                if(ct.substring(e , r).equals(sur)==true){
                    k+=1;
                }
                e=r;
                r=e+1;}
            }

           if(sur.length()==2) {
                if(ct.substring(0 , 2).equals(sur)==true){
                    k+=1;
                }
                if(ct.substring(2 , 4).equals(sur)==true){
                    k+=1;
                }
                if(ct.substring(4 , 6).equals(sur)==true){
                    k+=1;
                }if(ct.substring(5 , 7).equals(sur)==true){
                    k+=1;
                }
            }

            //
           a=b+1;
           b=a+7;
       }
       System.out.println(cont);

       // ------------------------------------------------------------------------------

       for(int p=0;p<120;p++) {
            if(p%2==0){
            cot+=cont.substring(q,w)+"，";}
            else
                cot+=cont.substring(q,w)+"。"+"\n";

            q=w+1;
            w=q+7;
        }
        System.out.println(cot);
        System.out.println("\n"+k);

    }
}
